﻿IF EXISTS (SELECT * from sys.procedures p left join sys.schemas s on p.schema_id = s.schema_id where p.name='budget_update' and s.name='Budget')
DROP PROCEDURE [Budget].budget_update
GO
CREATE PROCEDURE [Budget].budget_update 
@PK uniqueidentifier, 
@MainBudgetID uniqueidentifier, 
@Name nvarchar(100), 
@Start date, 
@End date, 
@Comment nvarchar(500), 
@LastVersion bit, 
@Validated bit
AS
BEGIN
UPDATE [Budget].[Budgets] 
SET	[id_main_budget] = @MainBudgetID ,
	[name] = @Name ,
	[start] = @Start ,
	[end] = @End ,
	[comment] = @Comment ,
	[last_version] = @LastVersion ,
	[validated] = @Validated 
WHERE
	[id_budget] = @PK 
END